<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<div th:fragment="sidebar" id="sidebar" class="sidebar sidebar-fixed responsive ace-save-state">
    <script type="text/javascript">
        try {
            ace.settings.loadState('sidebar')
        } catch (e) {
        }
    </script>

    <ul class="nav nav-list">
        <li class="active">
            <a href="#" th:href="@{management}">
                <i class="menu-icon fa fa-home"></i>
                <span class="menu-text"> 系统首页 </span>
            </a>
            <b class="arrow"></b>
        </li>

        <li th:if="${#arrays.contains(session.sysUser.permissions, 1)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-user-circle"></i>
                <span class="menu-text">
								管理员管理
							</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="manager">
                        <i class="menu-icon fa fa-caret-right"></i>
                        管理员列表
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="role">
                        <i class="menu-icon fa fa-caret-right"></i>
                        角色列表
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>

        <li th:if="${#arrays.contains(session.sysUser.permissions,2)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-users"></i>
                <span class="menu-text">
								用户管理
							</span>

                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="appuser">
                        <i class="menu-icon fa fa-caret-right"></i>
                        用户列表
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="feedback">
                        <i class="menu-icon fa fa-caret-right"></i>
                        用户反馈
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
        <li th:if="${#arrays.contains(session.sysUser.permissions,3)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-cubes"></i>
                <span class="menu-text">
								设备管理
							</span>

                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="sale">
                        <i class="menu-icon fa fa-caret-right"></i>
                        出售设备
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="fix">
                        <i class="menu-icon fa fa-caret-right"></i>
                        维修设备
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
        <li th:if="${#arrays.contains(session.sysUser.permissions, 4)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-comments"></i>
                <span class="menu-text">
								圈子管理
							</span>

                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="society">
                        <i class="menu-icon fa fa-caret-right"></i>
                        圈子中心
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
        <li th:if="${#arrays.contains(session.sysUser.permissions,5)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-commenting"></i>
                <span class="menu-text">
								短信推送管理
							</span>

                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="push">
                        <i class="menu-icon fa fa-caret-right"></i>
                        推送
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="message">
                        <i class="menu-icon fa fa-caret-right"></i>
                        短信
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="pushList">
                        <i class="menu-icon fa fa-caret-right"></i>
                        推送记录
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="messageList">
                        <i class="menu-icon fa fa-caret-right"></i>
                        短信记录
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
        <li th:if="${#arrays.contains(session.sysUser.permissions,6)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-newspaper-o"></i>
                <span class="menu-text">
								内容管理
							</span>

                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="advert">
                        <i class="menu-icon fa fa-caret-right"></i>
                        广告管理
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="product">
                        <i class="menu-icon fa fa-caret-right"></i>
                        产品介绍
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="news">
                        <i class="menu-icon fa fa-caret-right"></i>
                        新闻管理
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="about">
                        <i class="menu-icon fa fa-caret-right"></i>
                        关于我们
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="info">
                        <i class="menu-icon fa fa-caret-right"></i>
                        公司信息
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
        <li th:if="${#arrays.contains(session.sysUser.permissions,7)}" class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-bar-chart"></i>
                <span class="menu-text">
								统计
							</span>

                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="">
                    <a href="#" data-url="liveness">
                        <i class="menu-icon fa fa-caret-right"></i>
                        活跃量统计
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="diverSale">
                        <i class="menu-icon fa fa-caret-right"></i>
                        设备销售统计
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="">
                    <a href="#" data-url="messageSend">
                        <i class="menu-icon fa fa-caret-right"></i>
                        短信发送统计
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
    </ul><!-- /.nav-list -->

    <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
        <i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state"
           data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>

    <script>
        $(function () {
            $(".submenu li").on("click", function () {
                $(".nav li").removeClass("active");
                $(this).addClass("active");
                $(this).parent().parent().addClass("active");

                $("#right_content").load("management/" + $(this).find("a").data("url"));
            });
        });
    </script>

</div>
</html>